//@author A0106044W
package logic;
import java.util.logging.Level;

/**
 * 
 *
 * 	       Sothearith Sreang
 *         All of the Logic part is written by me.
 * 
 */

public class InvalidCommandHandler extends OperationHandler {
	
	String invalidCommand;
	
	public final String INVALID_COMMAND_MESSAGE = "The command \"%s\" is invalid. Please try again";
	public final String UNHANDLED_INVALID_COMMAND_EXCEPTION = "Command saved in previous command is not recognized. Check CommandHistory class.";
	
	public InvalidCommandHandler(String command) {
		super();
		invalidCommand = command;
	}
	
	public String execute() {
		String feedback = String.format(INVALID_COMMAND_MESSAGE, invalidCommand);
		return feedback;
	}
	
	public String undo() {
		String feedback = "";
		
		Logic.logger.log(Level.SEVERE, UNHANDLED_INVALID_COMMAND_EXCEPTION);
		
		return feedback;
	}
}
